/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.ec.generate.entity.GenerateAdvertise
   Module Description   :

   Date Created      : 2009/12/30
   Original Author   : feeling.wang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.ec.generate.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.yaodian100.core.common.entity.BaseEntity;

/**
 * @author feeling.wang
 * 
 */
@Entity(name = "generateAdvertise")
@Table(name = "EC_GENERATE_ADVERTISE")
@NamedQuery(name = "GenerateAdvertise.updateFailureAdvertise", query = "from generateAdvertise where advStatus in ('10','20') and to_date(to_char(endDate,'yyyy/MM/dd'),'yyyy/MM/dd') < to_date(to_char(sysdate,'yyyyMMdd'),'yyyy/MM/dd')")
public class GenerateAdvertise extends BaseEntity {
	private static final long serialVersionUID = 6998852476912749027L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "seq_ec_generate_advertise")
	@SequenceGenerator(name = "seq_ec_generate_advertise", sequenceName = "SEQ_EC_GENERATE_ADVERTISE")
	@Column(name = "ID")
	private Long id;

	@Column(name = "ADVERTISE_NAME", length = 30, nullable = false)
	private String advName;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "START_DATE", nullable = false)
	private Date startDate;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "END_DATE", nullable = false)
	private Date endDate;

	@Column(name = "ADVERTISE_TYPE", length = 20, nullable = false)
	private String advType;

	@Column(name = "ADVERTISE_STATUS", length = 2, nullable = false)
	private String advStatus;

	public String getAdvName() {
		return advName;
	}

	public String getAdvStatus() {
		return advStatus;
	}

	public String getAdvType() {
		return advType;
	}

	public Date getEndDate() {
		return endDate;
	}

	public Long getId() {
		return id;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setAdvName(String advName) {
		this.advName = advName;
	}

	public void setAdvStatus(String advStatus) {
		this.advStatus = advStatus;
	}

	public void setAdvType(String advType) {
		this.advType = advType;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

}
